<template>
  <div class="main_view">
    <!-- <van-pull-refresh v-model="isLoading" @refresh="onRefresh"> -->
      <router-view
        @update-bookInfo="getCatalogAllInfo"
        :catalogInfo="catalogInfo"
      ></router-view>
    <!-- </van-pull-refresh> -->
    <bottom-nav v-show="$route.meta.bottomBar == true"></bottom-nav>
  </div>
</template>
<script>
import BottomNav from "../components/BottomNav.vue";

export default {
  components: { BottomNav },
  data() {
    return {
      catalogInfo: null,
      isLoading: false,
    };
  },
  methods: {
    onRefresh() {
      setTimeout(() => {
        if (location.href.indexOf("#reloaded") == -1) {
          location.href = location.href + "#reloaded";
          location.reload();
        }
        this.$toast("刷新成功");
        this.isLoading = false;
      }, 1000);
    },
    getCatalogAllInfo(event) {
      this.catalogInfo = event;
    },
  },
};
</script>
<style lang="less" scoped>
.main_view {
  height: 100%;
}
</style>